package com.gary.spring.webContainer.A01;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author peng_rui
 * @date 2022/7/10
 */
@Controller
public class MyController {

    @RequestMapping(value = "/test1", method = RequestMethod.GET)
    public void test1() {
        System.out.println("test1");
    }

    @RequestMapping(value = "/test2", method = RequestMethod.GET)
    public ModelAndView testMv() {
        System.out.println("testMv");
        return new ModelAndView();
    }

    @RequestMapping(value = "/testToken", method = RequestMethod.GET)
    public ModelAndView testToken(@Token String token) {
        System.out.println("testToken : " + token);
        return null;
    }

    @MyYaml
    @RequestMapping(value = "/testResponse", method = RequestMethod.GET)
    public MyUser testResponse() {
        MyUser user = new MyUser("lisi", 20);
        System.out.println("testResponse");
        return user;
    }
}
